package com.javabean;

public class BoxArea {

	double length;
	double width;
	double height;
	
	public BoxArea() {
		length = 0;
		width = 0;
		height = 0;
	}
	
	public void setLength(double length) {
		this.length = length;
	}
	public double getLength() {
		return length;
	}
	public void setWidth(double width) {
		this.width = width;
	}
	public double getWidth() {
		return width;
	}
	public void setHeight(double height) {
		this.height = height;
	}
	public double getHeight() {
		return height;
	}
	
	public double volumn() { //求体积
		double volumnValue;
		volumnValue = length * width * height;
		return volumnValue;
	}
	
	public double surfaceArea() {
		double surfaceArea;
		surfaceArea = (length * width + length * height + width * height) * 2;
		return surfaceArea;
	}
	
	public static void main(String[] args) {
		BoxArea box = new BoxArea();
		box.setLength(2);
		box.setWidth(3);
		box.setHeight(5);
		System.out.println("长宽高分别为：" + box.getLength() + " " + box.getWidth() + " " + box.getHeight());
		System.out.println("体积为：" + box.volumn());
		System.out.println("表面积为：" +box.surfaceArea());
		
	}
}
